package com.ruoyi.erp.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.ProjectHourUserMapper;
import com.ruoyi.erp.domain.ProjectHourUser;
import com.ruoyi.erp.service.IProjectHourUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 工时用户Service业务层处理
 * 
 * @author sauger
 * @date 2022-04-12
 */
@Service
public class ProjectHourUserServiceImpl implements IProjectHourUserService 
{
    @Autowired
    private ProjectHourUserMapper projectHourUserMapper;

    /**
     * 查询工时用户
     * 
     * @param id 工时用户主键
     * @return 工时用户
     */
    @Override
    public ProjectHourUser selectProjectHourUserById(Integer id)
    {
        return projectHourUserMapper.selectProjectHourUserById(id);
    }

    /**
     * 查询工时用户列表
     * 
     * @param projectHourUser 工时用户
     * @return 工时用户
     */
    @Override
    public List<ProjectHourUser> selectProjectHourUserList(ProjectHourUser projectHourUser)
    {
        return projectHourUserMapper.selectProjectHourUserList(projectHourUser);
    }

    /**
     * 新增工时用户
     * 
     * @param projectHourUser 工时用户
     * @return 结果
     */
    @Override
    public int insertProjectHourUser(ProjectHourUser projectHourUser)
    {
        return projectHourUserMapper.insertProjectHourUser(projectHourUser);
    }

    /**
     * 修改工时用户
     * 
     * @param projectHourUser 工时用户
     * @return 结果
     */
    @Override
    public int updateProjectHourUser(ProjectHourUser projectHourUser)
    {
        return projectHourUserMapper.updateProjectHourUser(projectHourUser);
    }

    /**
     * 批量删除工时用户
     * 
     * @param ids 需要删除的工时用户主键
     * @return 结果
     */
    @Override
    public int deleteProjectHourUserByIds(String ids)
    {
        return projectHourUserMapper.deleteProjectHourUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除工时用户信息
     * 
     * @param id 工时用户主键
     * @return 结果
     */
    @Override
    public int deleteProjectHourUserById(Integer id)
    {
        return projectHourUserMapper.deleteProjectHourUserById(id);
    }

    @Override
    public List<ProjectHourUser> selectProjectHourUsersByDuration(Date beginDate, Date endDate) {
        return projectHourUserMapper.selectProjectHourUsersByDuration(beginDate, endDate);
    }
}
